#define _CRT_SECURE_NO_WARNINGS  1

class Solution {
public:
    vector<string> uncommonFromSentences(string s1, string s2) {
        string s = s1 + " " + s2;

        vector<string> vRet;
        for (size_t i = 0; i < s.size(); ++i)
        {
            string temp;
            while (i < s.size() && s[i] != ' ')
            {
                temp += s[i];
                ++i;
            }

            vRet.push_back(temp);
        }

        unordered_map<string, int> m;
        for (auto e : vRet)
            m[e]++;

        vRet.clear();

        for (auto e : m)
        {
            if (e.second == 1)
                vRet.push_back(e.first);
        }

        return vRet;
    }
};
